<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看方案页面</title>
    <link rel="stylesheet" href="../../res/layui/css/layui.css" media="all">
    <script src="../../res/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../res/layui/layui.js"></script>
    <script src="../../res/js/Tools.js" type="text/javascript" charset="utf-8"></script>
    <script>
        $(function(){
            findByAts();
            findByAthlete();
            findByExpert();
        })
        function findByAts(){
            var id=getQueryString("id");
            var url = "../../mentalityas/findBySchemeId";
            var data = {id:id};
            $.post(url,data,function(obj){
                console.info("方案:"+obj);
                $("#coachName").html(obj.coachName);
                $("#schemeName").html(obj.schemeName);
                if(obj.resultTime==null||obj.resultTime=="null"){
                    $("#resultTime").html("无");
                }else{
                    $("#resultTime").html(obj.resultTime);
                }
                if(obj.resultExp==null||obj.resultExp=="null"){
                    $("#resultExp").html("无");
                }else{
                    $("#resultExp").html(obj.resultExp);
                }
                if(obj.resultEffect==null||obj.resultEffect=="null"){
                    $("#resultEffect").html("无");
                }else{
                    $("#resultEffect").html(obj.resultEffect);
                }
                if(obj.resultFile==null||obj.resultFile=="null"){
                    $("#resultFile").html("无");
                }else{
                    $("#resultFile").html("<a href='../.."+obj.resultFile+"' class='layui-btn layui-btn-xs'>下载</a>");
                }
            },"json");
        }
        function findByAthlete(){
            var athleteName = "";
            var id=getQueryString("id");
            var url = "../../mentalityAthlete/findBySchemeId";
            var data = {id:id};
            $.post(url,data,function(obj){
                $.each(obj,function(index,item){
                    console.info("运动员:"+item.athleteName);
                    athleteName+= item.athleteName+",";
                });
                $("#athleteName").html(athleteName);
            },"json");
        }
        function findByExpert(){
            var auditState="";
            var id=getQueryString("id");
            var url = "../../mase/findBySaId";
            var data = {id:id};
            $.post(url,data,function(obj){
                console.info("专家咨询："+obj);
                if(obj.auditState=="10"){
                    auditState="申请中";
                }else if(obj.auditState=="20"){
                    auditState="中心领导已同意";
                }else if(obj.auditState=="21"){
                    auditState="中心领导不同意";
                }else if(obj.auditState=="30"){
                    auditState="专家已获知待回复";
                }else if(obj.auditState=="40"){
                    auditState="专家已回复";
                }else{
                    auditState="无";
                }
                if(obj.results==null||obj.results=="null"){
                    $("#results").html("无");
                }else{
                    $("#results").html("<a href='../.."+obj.results+"' class='layui-btn layui-btn-xs'>下载</a>");
                }
                if(obj.applyForExp==null||obj.applyForExp=='null'){
                    $("#auExp").html("无");
                }else{
                    $("#auExp").html(obj.applyForExp);
                }
                $("#auditState").html(auditState);
            },"json");
        }
    </script>
</head>
<body>
<div class="layui-form">
    <table class="layui-table" lay-even="" lay-skin="nob">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="100">
            <col>
        </colgroup>
        <tbody>
        <tr>
            <td>教练姓名</td>
            <td id="coachName"></td>
            <td>方案名称</td>
            <td id="schemeName"></td>
        </tr>
        <tr>
            <td>运动员姓名</td>
            <td id="athleteName"></td>
            <td>反馈时间</td>
            <td id="resultTime"></td>
        </tr>
        <tr>
            <td>实施情况</td>
            <td id="resultExp"></td>
            <td>实施效果</td>
            <td id="resultEffect"></td>
        </tr>
        <tr>
            <td>实施附件</td>
            <td id="resultFile"></td>
            <td>审核状态</td>
            <td id="auditState"></td>
        </tr>
        <tr>
            <td>审核意见</td>
            <td id="auExp"></td>
            <td>专家咨询结果</td>
            <td id="results"></td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>